package com.caishi.lkx.course.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zzw.common.entity.impl.BaseEntity;
import com.zzw.common.service.model.base.SortModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "kc_live", autoResultMap = true)
@Schema(title = "直播信息")
public class LiveModel extends BaseEntity<LiveModel> implements
        SortModel<LiveModel>{

    /**
     * 直播标题
     */
    private String title;

    /**
     * 直播链接
     */
    private String livePath;

    /** 科目id */
    private Long categoryId;

    /** 讲师名称 */
    private String teacherName;

    /** 排序 */
    private Integer sort;

    /** 直播开始时间 */
    private String startTime;

    /** 直播结束时间 */
    private String endTime;

    /** 直播日期 */
    private String liveDate;

    /** 科目名称 */
    @TableField(exist = false)
    private String categoryName;

    @TableField(exist = false)
    private Boolean freeFlag;

    @TableField(exist = false)
    private Long columnId;


    private String coverImg;

    private String teacherImg;
    @TableField(exist = false)
    private int appointmentNum;



    @Override
    public int hashCode() {
        return getId().hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof LiveModel gr) return gr.getId().equals(this.getId());
        return super.equals(obj);
    }

}
